from sqlalchemy import Column, Integer, String, DateTime, Numeric, Text
from sqlalchemy.sql import func
from app.core.database import Base

class ApartmentType(Base):
    __tablename__ = "apartment_types"
    
    id = Column(Integer, primary_key=True, index=True)
    type_code = Column(String(10), unique=True, nullable=False, index=True)
    type_name = Column(String(50), nullable=False)
    base_price = Column(Numeric(10, 2), nullable=False)
    plan_image_url = Column(String(500), nullable=True)
    description = Column(Text, nullable=True)
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), onupdate=func.now())

